home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
e
/
mailinglists
/
amigae.0294feb.archive
/
000071_donews!crash!w….std.com!cosell_Thu, 17 Feb 94 08:50:25 PST.msg
< prev
next >
Wrap
Internet Message Format
|
1994-05-26
|
7KB
Received: by bkhouse.cts.com (V1.17-beta/Amiga)
id <1uym@bkhouse.cts.com>; Thu, 17 Feb 94 08:50:25 PST
Received: from crash by donews.cts.com with uucp
(Smail3.1.28.1 #18) id m0pX3fK-0002VAC; Thu, 17 Feb 94 03:00 EST
Received: from relay2.UU.NET by crash.cts.com with smtp
(Smail3.1.28.1 #18) id m0pX3Cb-0000NDC; Wed, 16 Feb 94 23:31 PST
Received: from world.std.com by relay2.UU.NET with SMTP
(5.61/UUNET-internet-primary) id AAwdpm23647; Thu, 17 Feb 94 02:31:08 -0500
Received: by world.std.com (5.65c/Spike-2.0)
id AA15152; Thu, 17 Feb 1994 02:31:06 -0500
In-Reply-To: <9402141509.AA01061@plucky.safb.af.mil>
(from bwills@plucky.safb.af.mil (Barry D Wills))
(at Mon, 14 Feb 94 09:09:55 CST)
X-Mailer: //\\miga Electronic Mail (AmiElm 2.253)
Content-Length: 2691
Date: Wednesday, 16 February 1994 19:13 EST
Organization: Fantasy Farm Fibers
Message-Id: <5890:69185@fantasyfarm.com>
From: bernie@fantasyfarm.com (Bernie Cosell)
To: AmigaE@bkhouse.cts.com (The AmigaE Mailing List)
Subject: Re: Bugs in the Mod() function
In <9402141509.AA01061@plucky.safb.af.mil> on Feb 14, Barry D Wills wrote:
} I forgot to mention, Bernie, that the reference says:
}
} [QUOTE]
}
} a:=Mod(b,c)
}
} Divides 32bit b by 16bit c and returns 16bit modulo a
}
} [ENDQUOTE]
Right, and in EVERY example you cited in your previous message you
carefully [and correctly] used the term "remainder". The fact is
that this statement [QUOTE or not] is incorrect... 'modulo' is a
perfectly well-defined term [go check a textbook on abstract algebra
or group theory or galois fields or the like[*]] and what E implements
*ain't* modulo. I wish it _were_, since modulo is a useful arithmetic
function to have.
[*] For example, the ARexx reference I have here gives the usual
simple explanation: "what is called 'modulo arithmetic', or,
from its most familiar illustration in everyday life, 'clock arithmetic'.
What is the sum of ten and seven? Seventeen? Not on a twelve-hour
clock: the answer is five. You could say that adding twelve on a clock
is equivalent to adding zero, since it leaves the hands in the same
position. ..."
} This will give weird results if c exceeds max-int.
} Wouter likes it this way, so I made a function that
} does 32bit modulo:
}
} PROC mod(this, bythat) RETURN this-Mul(bythat, Div(this, bythat))
Unfortunately it doesn't. It returns the *remainder*. Not the same
as modulo. [actually it would be if EEs, the guys that designed
the ALUs on the CPU chips, had even the merest beginning of a clue
about how arithmetic works. For a VERY long time I've argued about
this with hardware designers... they take the attitude that since
*THEY* don't know enough math to be able to tell the difference
they figure it doesn't matter, and so CPUs implement all sorts of
truly *dumb* conventions when it comes to whats-the-quotient and
whats-the-remainder. I've learned to live with that [gritting my
teeth, of course]. I'm not as complacent about doing so with
"modulo", since there is *no*reason* to make that confusing
[and/or pretend that because _you_ don't know what the precise
definition of modulo arithmetic is, that there isn't one and so
it doesn't matter what you do]. As I suggested, if Wouter just
changes the docs to call it "Rem" or some such, my program wouldn't
have been any closer-to-working but at least it'd have been clear
what is going on.
Not a big deal in any scheme of things, but one of my hot-buttons since
I've been trying to argue some _basic_ math into hardheaded hardware
designers for almost 30 years now....
/Bernie\
--
Bernie Cosell bernie@fantasyfarm.com
Fantasy Farm Fibers, Pearisburg, VA (703) 921-2358
From donews!crash!rbhp56.rbg.informatik.th-darmstadt.de!anh Thu, 17 Feb 94 09:05:57 PST
Received: by bkhouse.cts.com (V1.17-beta/Amiga)
id <1v0o@bkhouse.cts.com>; Thu, 17 Feb 94 09:05:57 PST
Received: from crash by donews.cts.com with uucp
(Smail3.1.28.1 #18) id m0pX8NU-0002VVC; Thu, 17 Feb 94 08:02 EST
Received: from rbhp89.rbg.informatik.th-darmstadt.de by crash.cts.com with smtp
(Smail3.1.28.1 #18) id m0pX8Fn-000092C; Thu, 17 Feb 94 04:54 PST
Received: from rbhp48.rbg.informatik.th-darmstadt.de by rbhp89.rbg.informatik.th-darmstadt.de with SMTP
(1.36.108.4/15.6) id AA25226; Thu, 17 Feb 1994 13:54:52 +0100
Received: by rbhp48.rbg.informatik.th-darmstadt.de
(1.36.108.4/15.6) id AA18675; Thu, 17 Feb 1994 13:54:44 +0100
Message-Id: <m0pX8Fn-000092C@crash.cts.com>
Date: Thu, 17 Feb 94 13:54:43 MEZ
Full-Name: Olivier Anh
In-Reply-To: <01H8W57N2HAA8WXIC2@delphi.com>; from "NES@delphi.com" at Feb 14, 94 10:54 pm
Mailer: Elm [revision: 66.25]
From: Olivier Anh <anh@rbhp56.rbg.informatik.th-darmstadt.de>
To: AmigaE@bkhouse.cts.com (The AmigaE Mailing List)
Subject: Re: int to string's
Hi Eric !
>
> {Is there a E command to convert a number to a ASCII string?
> Also what is the correct way to put an image on a Gadget button?
> and memory for it.
Yep, there is one, I learn from Barry, or Trey,....
It is the StringF() function :
DEF l,
str[10] : STRING
l:=10
StringF(str,'\d',l)
WriteF('The string is \s\n',str)
...
--
-------------------------------------------------------------------------------
/ / Olivier ANH |' And may the Force be with You ! '
\ X / anh@rbg.informatik.th-darmstadt.de | - Return of the Jedi -
-------------------------------------------------------------------------------
From donews!crash!dcs.gla.ac.uk!mccracal Thu, 17 Feb 94 09:06:11 PST
Received: by bkhouse.cts.com (V1.17-beta/Amiga)
id <1v0w@bkhouse.cts.com>; Thu, 17 Feb 94 09:06:11 PST
Received: from crash by donews.cts.com with uucp
(Smail3.1.28.1 #18) id m0pX8p7-0002VBC; Thu, 17 Feb 94 08:31 EST
Received: from vanuata.dcs.gla.ac.uk by crash.cts.com with smtp
(Smail3.1.28.1 #18) id m0pX8eq-0000IYC; Thu, 17 Feb 94 05:20 PST
Received: from atka.dcs.gla.ac.uk by goggins.dcs.gla.ac.uk with LOCAL SMTP (PP)
id <24899-0@goggins.dcs.gla.ac.uk>; Thu, 17 Feb 1994 13:20:19 +0000
Received: by atka.dcs.gla.ac.uk (4.1/Dumb) id AA25028;
Thu, 17 Feb 94 13:20:10 GMT
Date: Thu, 17 Feb 94 13:20:10 GMT
Message-Id: <9402171320.AA25028@atka.dcs.gla.ac.uk>
From: mccracal@dcs.gla.ac.uk
To: amigae@bkhouse.cts.com
Subject: fd2module
I have written a program to convert fd files to E modules.
Well in all honesty it is actually just a hack to Wouter's
pragma2module so that it reads fd files instead of pragma files.
If anybody wants it I could mail it here once I get around to
documenting it.
Alex McCracken
Weinberg's Second Law:
If builders built buildings the way programmers wrote programs,
then the first woodpecker that came along would destroy civilization!